package com.siysoft.tc.admin.action;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.siysoft.tc.admin.service.IAdminUserReservationService;
import com.siysoft.util.IMap;



/**
 * <p>Title: AdminUserReservationController</p>
 * <p>Description:咨询管理功能</p>
 * <p>Company: dmpb</p>
 * @author    victor
 * @date       2015年11月12日
 */
@Controller
@RequestMapping(value = "/admin/userReservation")
public class AdminUserReservationController {
	@Autowired
	IAdminUserReservationService userReservationService;
	
	
	//参与记录管理
	@RequestMapping(value = "/toUserReservation")
	public String toUserReservation(HttpServletRequest request) throws Exception{
		IMap iMap = new IMap(request);
		List<Map<String,Object>> seekUserReservations = userReservationService.seekUserReservations(iMap);
		request.setAttribute("userReservationList", seekUserReservations);
		return "/admin/reservation/userReservationList";
	}
	//跳转到修改付款审批的状态
	@RequestMapping(value = "/toUserReservationRevise")
	public String toReservationRevise(HttpServletRequest request) throws Exception{
		IMap iMap = new IMap(request);
		Map<String, String>reservationRevise = userReservationService.toUserReservationRevise(iMap);
		request.setAttribute("userReservation", reservationRevise);
		return "/admin/reservation/userReservationRevise";
	}
	
	//跳转到修改付款审批的状态
	@RequestMapping(value = "/userReservationRevise")
	public String ReservationRevise(HttpServletRequest request) throws Exception{
		IMap iMap = new IMap(request);
		userReservationService.reviseUserReservationInfo(iMap);
		return "redirect:/admin/userReservation/toUserReservation.htm";
	}
	
	//跳转到修改付款审批的状态
	@RequestMapping(value = "/removeUser")
	public String removeUser(HttpServletRequest request) throws Exception{
		IMap iMap = new IMap(request);
		userReservationService.removeUser(iMap);
		return "redirect:/admin/userReservation/toUserReservation.htm";
	}
	
	
	
}
